<?php
namespace DAOZHEN;
if (! isset($_SESSION)) {
    session_start();
}
include (dirname(dirname(dirname(__FILE__))) . "/zhconfig/Config.php");
include (ZH_PATH . DS . MANAGERFPATH . DS . 'islogin' . ZH);
$moduleid = SafeRequest(getPGC('moduleid'), 0);
$qianzui = SafeRequest(getPGC('qianzui'), 0);
$mulu = SafeRequest(getPGC('mulu'), 0);
$name = SafeRequest(getPGC('name'), 0);
$rpctype = SafeRequest(getPGC('rpctype'), 0);
$rpcurl = SafeRequest(getPGC('rpcurl'), 0);
$rpcmainkey = SafeRequest(getPGC('rpcmainkey'), 0);
$rpchost = SafeRequest(getPGC('rpchost'), 0);
$rpcprivatekey = SafeRequest(getPGC('rpcprivatekey'), 0);
$rpcmoduleid = SafeRequest(getPGC('rpcmoduleid'), 0);
$modulename = "DAOZHEN";

// 执行数据表
$addtables = new \DAOZHEN\D\Admin_TablesB();
$addtables->add($qianzui, "/" . $mulu . "/d/", "/" . $mulu . "/admin/", $modulename, $moduleid,$mulu, "/" . $mulu . "/rpc/", $rpctype, $rpcurl, $rpcmainkey, $rpchost, $rpcprivatekey, $rpcmoduleid);

//插入后台菜单

$addmenu = new \ZHMVC\D\Menu();
$menudata=$addmenu->getOne1("pid='0' and menuname='".$qianzui."'");
$lastid = $menudata['id'];

$addmenu->add($lastid,$qianzui,"广告管理","/".$mulu."/"."admin/admin_adsense.php");

echo "安装成功<br />";
?>
</body>
</html>